@layout('layout2')

@section('page-content')
@if (Session::has('msg'))
    <div class="msg">
        {{ Session::get('msg') }}
    </div>
@endif
<form action="{{ URI::current() }}" method="post" id="channel-selecting-form">
@foreach ($data as $key => $curWk)
    <div class="control-group">
        <label for="wk_{{ $key }}">{{ $curWk['name'] }}</label>
        <div class="controls">
            <select name="wk_{{ $key }}" id="wk_{{ $key }}">
                @foreach ($curWk['channels'] as $channelKey => $channelName)
                <option value="{{ $channelKey }}" {{  $curWk['channel_selected'] ==  $channelKey ? 'selected' : ''}}>
                    {{ $channelName }}
                </option>
                @endforeach
            </select>
        </div>
    </div>
@endforeach

    <div class="control-group button">
        <div class="controls">
            <button type="submit">{{ __('m.update') }}</button>
        </div>
    </div>
</form>
@endsection